<?php require_once(dirname(__FILE__)."/config/config.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>修改密码</title>
<link href="http://www.dianexia.com/css/public/forward.css" type="text/css" rel="stylesheet"></link>
<style type="text/css"></style>
</head>

<body screen_capture_injected="true">
<div id="background"></div>
<br/>
<center>
<h2 style="margin-top:80px;padding:10px"><b>修改密码</b></h2>
<form method="post">
新密码:&nbsp;&nbsp;
<input name="NewPassword" type="password" id="NewPassword" size="20" /><br />
确认密码:
<input name="NewPasswordAgain" type="password" id="NewPasswordAgain"  size="20"/><br />
<input name="submit" type="submit" value="提交" />
</form>
</center>
<?php 
	  $NewPassword=$_POST['NewPassword'];
	  $NewPasswordAgain=$_POST['NewPasswordAgain'];
	  $user_id=base64_decode($_GET['a']);
	  $time=base64_decode($_GET['time']);
	 //  echo $time;
	 // echo $user_id;
	 if((date("YmdHis") - $time) <= 1000000){
	  if(isset($_POST['submit']))
	{
	  if($NewPassword==$NewPasswordAgain)
	  {
	  
	  	 if(strlen($NewPassword)<6){
		echo "<script>alert('密码长度不能少于6位!')</script>";
	 }else{
	 	$sql = "update zy_user set  password='".$NewPassword."' where user_id='".$user_id."'";
		mysql_query($sql);
		echo "<script>alert('密码修改成功')</script>";
  echo "<script>location.href='user_login.php';</script>";
	 }
	  }else{
	  echo "<script>alert('请确认两次输入的密码前后一致!')</script>";
	  }
  }
  
}else{
					echo "<script type='text/javascript'>alert('超过限定时间内修改密码！');location.href='forget_password.php'</script>";
				}

 ?>
</body>
</html>
